<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>个人资料</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="format-detection" content="telephone=no" />
  <jsp:include page="/jsp/inc_head.jsp"></jsp:include>
<style>
    #zhezhao{
    background:#333;
    bottom: 0;
	width:100%;
    display: none;
    left: 0;
    opacity: 0.9;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
	}
    .zzcltext{
		font-size:18px;
		color:#fff;
		margin-top: 200px;
		text-align:center;
		font-family: "Segoe UI","Lucida Grande",Helvetica,Arial,"Microsoft YaHei",FreeSans,Arimo,"Droid Sans","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",FontAwesome,sans-serif;
	}
</style>
</head>

<body style="padding-bottom:50px;">
<div class="am-g">
    <div class="am-u-sm-12 am-pad-none">
    	<div class="am-u-sm-12 am-pad-none grzl_lie">
        	<div class="am-u-sm-3">
            	生日
            </div>
            <div class="am-u-sm-9 am-text-right">
            	<input id="birthDay" type="DATE" value="" placeholder="请填写您的生日"/>
            </div>
        </div>
    </div>
</div>
<div onclick="save();" class="am-g btm_fixed">
	<div class="am-u-sm-12 am-text-center">
    	保存
    </div>
</div>
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
	<div class="am-modal-dialog">
		<div class="am-modal-hd" id="alert_title">哎呦喂，出错啦</div>
		<div class="am-modal-bd" id="alert_message"></div>
		<div class="am-modal-footer">
			  <span class="am-modal-btn">确定</span>
		</div>
	</div>
</div>
<div id="zhezhao">
	<div class="zzcltext">
	         正在处理，请稍等。。。。
	</div>
</div>
<input type="hidden" id="sex" value="1" />
<script>
 var ajaxpath="${pageContext.request.contextPath}";

$(function(){
	loudMyInfo();
});

//加载个人资料
function loudMyInfo(){
    var url=ajaxpath+"/userCenter/getUserCenterInfo.do?";
	$.get(url, function(data){
		//alert(data.birthDay);
	     if(data.birthDay!=null&&data.birthDay!=""){
	         $("#birthDay").val(data.birthDay);
	     }
	});
}


function save(){
    var birthDay=$("#birthDay").val();

    if (!birthDay) {
		$("#alert_message").html("生日不可为空");
		$("#my-alert").modal('open');  					
		return;
	}
	$("#zhezhao").css("display","block");//遮罩层
	var url=ajaxpath+"/userCenter/saveMyInfoBirthDay.do?birthDay=" + birthDay;
	$.get(url, function(data){
	     if (data.result == "success") {
				$("#alert_title").html("提示");
				$("#alert_message").html("保存成功！");
				$("#my-alert").modal('open');
				window.location.href = ajaxpath+"/client_toClientCenter.do?guid="+ new Date(); 
		  } else {
				$("#alert_message").html("保存失败!");
				$("#my-alert").modal('open');
				$("#zhezhao").css("display","none");//遮罩层
		  }
	});
}
</script>
</body>
</html>
